namespace SqlQueryBuilder.Clauses
{
    /// <summary>
    /// Groupe by Clause
    /// </summary>
    public class GroupByClause
    {
        /// <summary>
        /// Gets or sets the group by field.
        /// </summary>
        /// <value>The group by clause.</value>
        public string groupByClause { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="GroupByClause"/> class.
        /// </summary>
        /// <param name="field">The field.</param>
        public GroupByClause(string field)
        {
            groupByClause = field;
        }

        /// <summary>
        /// Performs an implicit conversion from <see cref="System.String"/> to <see cref="SqlQueryBuilder.Clauses.GroupByClause"/>.
        /// </summary>
        /// <param name="groupByClause">The group by clause.</param>
        /// <returns>The result of the conversion.</returns>
        public static implicit operator GroupByClause(string groupByClause)
        {
            return new GroupByClause(groupByClause);
        }
    }
}